"""
  Scoruino - Scoringboard for the arduino

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
Import("avr")
arduino_stuff = [
        "pins_arduino.c",
        "wiring.c",
        "wiring_analog.c",
        "wiring_digital.c",
        "wiring_pulse.c",
        "wiring_serial.c",
        "wiring_shift.c",
        "WInterrupts.c",
        "HardwareSerial.cpp",
        "WMath.cpp",
        "Print.cpp",
    ]
def c_to_o(fname): # UGLY WART
    name, ending = fname.rsplit('.',1)
    return name + ".o"

#objects = [avr.Object(c_to_o(fname), avr.subst("${ARDUINO}/"+fname)) for fname in arduino_stuff]
objects = [c_to_o(avr.subst("${ARDUINO}/"+name)) for name in arduino_stuff]
lib = avr.StaticLibrary('arduino', objects)
#Install('../include',Glob('*.h'))
Return('lib')
